home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / DCLAP 4j / vibrant / ncbidraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  10.1 KB  |  262 lines  |  [TEXT/R*ch]

  1. /*   ncbidraw.h
  2. * ===========================================================================
  3. *
  4. *                            PUBLIC DOMAIN NOTICE
  5. *            National Center for Biotechnology Information (NCBI)
  6. *
  7. *  This software/database is a "United States Government Work" under the
  8. *  terms of the United States Copyright Act.  It was written as part of
  9. *  the author's official duties as a United States Government employee and
  10. *  thus cannot be copyrighted.  This software/database is freely available
  11. *  to the public for use. The National Library of Medicine and the U.S.
  12. *  Government do not place any restriction on its use or reproduction.
  13. *  We would, however, appreciate having the NCBI and the author cited in
  14. *  any work or product based on this material
  15. *
  16. *  Although all reasonable efforts have been taken to ensure the accuracy
  17. *  and reliability of the software and data, the NLM and the U.S.
  18. *  Government do not and cannot warrant the performance or results that
  19. *  may be obtained by using this software or data. The NLM and the U.S.
  20. *  Government disclaim all warranties, express or implied, including
  21. *  warranties of performance, merchantability or fitness for any particular
  22. *  purpose.
  23. *
  24. * ===========================================================================
  25. *
  26. * File Name:  ncbidraw.h
  27. *
  28. * Author:  Jonathan Kans
  29. *
  30. * Version Creation Date:   1/1/91
  31. *
  32. * $Revision: 2.4 $
  33. *
  34. * File Description: 
  35. *       Vibrant drawing procedure definitions
  36. *
  37. * Modifications:  
  38. * --------------------------------------------------------------------------
  39. * Date     Name        Description of modification
  40. * -------  ----------  -----------------------------------------------------
  41. *
  42. *
  43. * ==========================================================================
  44. */
  45.  
  46. #ifndef _NCBIDRAW_
  47. #define _NCBIDRAW_
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. /***  PORTABLE GRAPHIC PRIMITIVE OBJECT TYPES  ***/
  54.  
  55. /*
  56. *  Platform independent point and rectangle data structures.
  57. */
  58.  
  59. typedef  struct  Nlm_point {
  60.   Nlm_Int2  x;
  61.   Nlm_Int2  y;
  62. } Nlm_PoinT, PNTR Nlm_PointPtr;
  63.  
  64. typedef  struct  Nlm_rect {
  65.   Nlm_Int2  left;
  66.   Nlm_Int2  top;
  67.   Nlm_Int2  right;
  68.   Nlm_Int2  bottom;
  69. } Nlm_RecT, PNTR Nlm_RectPtr;
  70.  
  71. typedef  Nlm_Handle  Nlm_RegioN;
  72.  
  73. typedef  struct  Nlm_font {
  74.   Nlm_VoidPtr  dummy;
  75. } HNDL Nlm_FonT;
  76.  
  77. /***  GLOBAL VARIABLES  ***/
  78.  
  79. /*
  80. *  The update region contains the update region on drawing requests,
  81. *  and contains at least the visible region during other callbacks.
  82. *  Clipping is set to the update region on drawing events.  The
  83. *  update rectangle has the minimum rectangular boundary of the
  84. *  update region.  These variables are kept up to date by the Vibrant
  85. *  event loop.
  86. */
  87.  
  88. extern  Nlm_RegioN  Nlm_updateRgn;
  89. extern  Nlm_RecT    Nlm_updateRect;
  90.  
  91. /*
  92. *  The standard systemFont and programFont variables are used to
  93. *  specify fonts for dialog objects and scrolling text objects.
  94. */
  95.  
  96. extern  Nlm_FonT  Nlm_systemFont;
  97. extern  Nlm_FonT  Nlm_programFont;
  98.  
  99. /*
  100. *  Miscellaneous constants for pixel sizes of the standard font.
  101. */
  102.  
  103. extern  Nlm_Int2  Nlm_stdAscent;
  104. extern  Nlm_Int2  Nlm_stdDescent;
  105. extern  Nlm_Int2  Nlm_stdLeading;
  106. extern  Nlm_Int2  Nlm_stdFontHeight;
  107. extern  Nlm_Int2  Nlm_stdLineHeight;
  108. extern  Nlm_Int2  Nlm_stdCharWidth;
  109.  
  110. /***  DRAWING PROCEDURES  ***/
  111.  
  112. void         Nlm_SetUpDrawingTools PROTO((void));
  113. void         Nlm_CleanUpDrawingTools PROTO((void));
  114.  
  115. /*
  116. *  It is not necessary to create a new font when switching colors.  The
  117. *  family for GetFont can be Roman, Swiss, Modern, Script, or Decorative.
  118. */
  119.  
  120. /*
  121. *  ScrollRect will erase and invalidate all invalid regions.
  122. */
  123.  
  124. void         Nlm_ResetDrawingTools PROTO((void));
  125.  
  126. void         Nlm_CopyMode PROTO((void));
  127. void         Nlm_MergeMode PROTO((void));
  128. void         Nlm_InvertMode PROTO((void));
  129. void         Nlm_EraseMode PROTO((void));
  130.  
  131. void         Nlm_Black PROTO((void));
  132. void         Nlm_Red PROTO((void));
  133. void         Nlm_Green PROTO((void));
  134. void         Nlm_Blue PROTO((void));
  135. void         Nlm_Cyan PROTO((void));
  136. void         Nlm_Magenta PROTO((void));
  137. void         Nlm_Yellow PROTO((void));
  138. void         Nlm_White PROTO((void));
  139. void         Nlm_Gray PROTO((void));
  140. void         Nlm_LtGray PROTO((void));
  141. void         Nlm_DkGray PROTO((void));
  142. void         Nlm_SelectColor PROTO((Nlm_Uint1 red, Nlm_Uint1 green, Nlm_Uint1 blue));
  143. Nlm_Uint4    Nlm_GetColor PROTO((void));
  144. void         Nlm_SetColor PROTO((Nlm_Uint4 color));
  145. void         Nlm_InvertColors PROTO((void));
  146.  
  147. void         Nlm_Solid PROTO((void));
  148. void         Nlm_Dark PROTO((void));
  149. void         Nlm_Medium PROTO((void));
  150. void         Nlm_Light PROTO((void));
  151. void         Nlm_Empty PROTO((void));
  152. void         Nlm_Dotted PROTO((void));
  153. void         Nlm_Dashed PROTO((void));
  154. void         Nlm_WidePen PROTO((Nlm_Int2 width));
  155.  
  156. Nlm_FonT     Nlm_GetFont PROTO((Nlm_CharPtr name, Nlm_Int2 size, Nlm_Boolean bld, Nlm_Boolean itlc, Nlm_Boolean undrln, Nlm_CharPtr fmly));
  157. Nlm_FonT     Nlm_ParseFont PROTO((Nlm_CharPtr spec));
  158. void         Nlm_SelectFont PROTO((Nlm_FonT f));
  159. void         Nlm_AssignPrinterFont PROTO((Nlm_FonT scrnFont, Nlm_FonT prtrFont));
  160.  
  161. Nlm_Int2     Nlm_CharWidth PROTO((Nlm_Char ch));
  162. Nlm_Int2     Nlm_StringWidth PROTO((Nlm_CharPtr text));
  163. Nlm_Int2     Nlm_TextWidth PROTO((Nlm_CharPtr text, Nlm_sizeT len));
  164. Nlm_Int2     Nlm_Ascent PROTO((void));
  165. Nlm_Int2     Nlm_Descent PROTO((void));
  166. Nlm_Int2     Nlm_Leading PROTO((void));
  167. Nlm_Int2     Nlm_FontHeight PROTO((void));
  168. Nlm_Int2     Nlm_LineHeight PROTO((void));
  169. Nlm_Int2     Nlm_MaxCharWidth PROTO((void));
  170.  
  171. void         Nlm_SetPen PROTO((Nlm_PoinT pt));
  172. void         Nlm_GetPen PROTO((Nlm_PointPtr pt));
  173.  
  174. void         Nlm_PaintChar PROTO((Nlm_Char ch));
  175. void         Nlm_PaintString PROTO((Nlm_CharPtr text));
  176. void CDECL   Nlm_PaintText VPROTO((char *format, ...));
  177.  
  178. void         Nlm_DrawString PROTO((Nlm_RectPtr r, Nlm_CharPtr text, Nlm_Char jst, Nlm_Boolean gray));
  179. void         Nlm_DrawText PROTO((Nlm_RectPtr r, Nlm_CharPtr text, Nlm_sizeT len, Nlm_Char jst, Nlm_Boolean gray));
  180.  
  181. void         Nlm_MoveTo PROTO((Nlm_Int2 x, Nlm_Int2 y));
  182. void         Nlm_LineTo PROTO((Nlm_Int2 x, Nlm_Int2 y));
  183. void         Nlm_DrawLine PROTO((Nlm_PoinT pt1, Nlm_PoinT pt2));
  184.  
  185. void         Nlm_LoadPt PROTO((Nlm_PointPtr pt, Nlm_Int2 x, Nlm_Int2 y));
  186. void         Nlm_AddPt PROTO((Nlm_PoinT src, Nlm_PointPtr dst));
  187. void         Nlm_SubPt PROTO((Nlm_PoinT src, Nlm_PointPtr dst));
  188. Nlm_Boolean  Nlm_EqualPt PROTO((Nlm_PoinT p1, Nlm_PoinT p2));
  189. Nlm_Boolean  Nlm_PtInRect PROTO((Nlm_PoinT pt, Nlm_RectPtr r));
  190. Nlm_Boolean  Nlm_PtInRgn PROTO((Nlm_PoinT pt, Nlm_RegioN rgn));
  191.  
  192. void         Nlm_LoadRect PROTO((Nlm_RectPtr r, Nlm_Int2 lf, Nlm_Int2 tp, Nlm_Int2 rt, Nlm_Int2 bt));
  193. void         Nlm_UpsetRect PROTO((Nlm_RectPtr r, Nlm_Int2 lf, Nlm_Int2 tp, Nlm_Int2 rt, Nlm_Int2 bt));
  194. void         Nlm_OffsetRect PROTO((Nlm_RectPtr r, Nlm_Int2 dx, Nlm_Int2 dy));
  195. void         Nlm_InsetRect PROTO((Nlm_RectPtr r, Nlm_Int2 dx, Nlm_Int2 dy));
  196. Nlm_Boolean  Nlm_SectRect PROTO((Nlm_RectPtr src1, Nlm_RectPtr src2, Nlm_RectPtr dst));
  197. Nlm_Boolean  Nlm_UnionRect PROTO((Nlm_RectPtr src1, Nlm_RectPtr src2, Nlm_RectPtr dst));
  198. Nlm_Boolean  Nlm_EqualRect PROTO((Nlm_RectPtr r1, Nlm_RectPtr r2));
  199. Nlm_Boolean  Nlm_EmptyRect PROTO((Nlm_RectPtr r));
  200. Nlm_Boolean  Nlm_RectInRect PROTO((Nlm_RectPtr r1, Nlm_RectPtr r2));
  201. Nlm_Boolean  Nlm_RectInRgn PROTO((Nlm_RectPtr r, Nlm_RegioN rgn));
  202.  
  203. void         Nlm_EraseRect PROTO((Nlm_RectPtr r));
  204. void         Nlm_FrameRect PROTO((Nlm_RectPtr r));
  205. void         Nlm_PaintRect PROTO((Nlm_RectPtr r));
  206. void         Nlm_InvertRect PROTO((Nlm_RectPtr r));
  207. void         Nlm_ScrollRect PROTO((Nlm_RectPtr r, Nlm_Int2 dx, Nlm_Int2 dy));
  208.  
  209. void         Nlm_EraseOval PROTO((Nlm_RectPtr r));
  210. void         Nlm_FrameOval PROTO((Nlm_RectPtr r));
  211. void         Nlm_PaintOval PROTO((Nlm_RectPtr r));
  212. void         Nlm_InvertOval PROTO((Nlm_RectPtr r));
  213.  
  214. void         Nlm_EraseRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  215. void         Nlm_FrameRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  216. void         Nlm_PaintRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  217. void         Nlm_InvertRoundRect PROTO((Nlm_RectPtr r, Nlm_Int2 ovlWid, Nlm_Int2 ovlHgt));
  218.  
  219. void         Nlm_EraseArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  220. void         Nlm_FrameArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  221. void         Nlm_PaintArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  222. void         Nlm_InvertArc PROTO((Nlm_RectPtr r, Nlm_PoinT start, Nlm_PoinT end));
  223.  
  224. void         Nlm_ErasePoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  225. void         Nlm_FramePoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  226. void         Nlm_PaintPoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  227. void         Nlm_InvertPoly PROTO((Nlm_Int2 num, Nlm_PointPtr pts));
  228.  
  229. Nlm_RegioN   Nlm_CreateRgn PROTO((void));
  230. Nlm_RegioN   Nlm_DestroyRgn PROTO((Nlm_RegioN rgn));
  231. void         Nlm_ClearRgn PROTO((Nlm_RegioN rgn));
  232. void         Nlm_LoadRectRgn PROTO((Nlm_RegioN rgn, Nlm_Int2 lf, Nlm_Int2 tp, Nlm_Int2 rt, Nlm_Int2 bt));
  233. void         Nlm_OffsetRgn PROTO((Nlm_RegioN rgn, Nlm_Int2 dx, Nlm_Int2 dy));
  234. void         Nlm_SectRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  235. void         Nlm_UnionRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  236. void         Nlm_DiffRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  237. void         Nlm_XorRgn PROTO((Nlm_RegioN src1, Nlm_RegioN src2, Nlm_RegioN dst));
  238. Nlm_Boolean  Nlm_EqualRgn PROTO((Nlm_RegioN rgn1, Nlm_RegioN rgn2));
  239. Nlm_Boolean  Nlm_EmptyRgn PROTO((Nlm_RegioN rgn));
  240.  
  241. void         Nlm_EraseRgn PROTO((Nlm_RegioN rgn));
  242. void         Nlm_FrameRgn PROTO((Nlm_RegioN rgn));
  243. void         Nlm_PaintRgn PROTO((Nlm_RegioN rgn));
  244. void         Nlm_InvertRgn PROTO((Nlm_RegioN rgn));
  245.  
  246. void         Nlm_ClipRect PROTO((Nlm_RectPtr r));
  247. void         Nlm_ClipRgn PROTO((Nlm_RegioN rgn));
  248. void         Nlm_ResetClip PROTO((void));
  249.  
  250. void         Nlm_ValidRect PROTO((Nlm_RectPtr r));
  251. void         Nlm_InvalRect PROTO((Nlm_RectPtr r));
  252. void         Nlm_ValidRgn PROTO((Nlm_RegioN rgn));
  253. void         Nlm_InvalRgn PROTO((Nlm_RegioN rgn));
  254.  
  255. void         Nlm_CopyBits PROTO((Nlm_RectPtr r, Nlm_VoidPtr source));
  256.  
  257. #ifdef __cplusplus
  258. }
  259. #endif
  260.  
  261. #endif
  262.